When you switch to another application, all modified files are automatically saved to the disk. When you come back to IDEA, it automatically detects all changes in the file structure. However this autosynchronization may take some time on a large project. You may turn of the autosynchronization in the "General" options (Tools | IDE Options...). To explicitly perform the synchronization use File | Synchronize.